home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ Oct 89 / Z0031-Re - Printing sever-Oct89 < prev    next >
Encoding:
Text File  |  1989-10-09  |  2.1 KB  |  62 lines  |  [TEXT/GEOL]

  1. Item    2003169                         9-Oct-89        08:34
  2.  
  3. From:   REDDEN                          Peat Marwick, Kevin Redden,VCA
  4.  
  5. To:     MADA.EUROPE                     MacApp Dev Assoc Europe, E Carrasco
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    RE - Printing several views
  10.  
  11. Father Vincent,
  12.  
  13. On the last project I worked on I had to implement something very similar to
  14. what you are trying to do.  The view was also a spreadsheet based on the CALC
  15. example and I ran in to the same problems with printing.  Like the CALC example
  16. I had a row titles view, column titles view, and a main cells view ( each
  17. having their own scrollers ) and each printed page had to contain the
  18. corresponding parts of each ( as well as a page header ).
  19.  
  20. The way I implemented it was as follows:
  21.  
  22. I gave the row and column title views their own decendants of TStdPrintHandler
  23. ( overriding only BreakFollowing ) and made each of these fields within the
  24. printhandler for the main Cells view.
  25.  
  26. I created a printhandler for the main Cells view ( overriding BreakFollowing,
  27. and DrawPageInterior ).
  28.  
  29. In DrawPageInterior I first called INHERITED DrawPageInterior and then I call a
  30. method to print the row and column titles.  The code for which goes something
  31. like this…
  32.  
  33. { Get the currently focused page }
  34. theCurPage := PageToStrip ( fFocusedPage );
  35.  
  36. { Print the column titles for the current page }
  37. thePageNum := fColPrintHandler.StripToPage ( 0, theCurPage.h );
  38. fColPrintHandler.SetPage ( thePageNum );
  39.  
  40. { Now focus on the page and print it ( I can't rememeber why I changed
  41. gCurrPrintHandler here but I'll leave it since it works }
  42. tempPrintHandler := gCurrPrintHandler;
  43. gCurrPrintHandler := fColPrintHandler;
  44. IF fColPrintHandler.Focus THEN;
  45. fColPrintHandler.FocusOnInterior;
  46. fColPrintHandler.DrawPageInterior;
  47. gCurrPrintHandler := tempPrintHandler;
  48.  
  49. ....
  50.  
  51. { and now do the same for the row titles view, and that is all I did }
  52.  
  53. All my overrides of BreakFollowing did was break on the last column and row
  54. that would fit on the page ( calculated by adding up the column widths and row
  55. heights ).
  56.  
  57. Hope this helps you,
  58.  
  59. Kevin Redden
  60. KPMG Peat Marwick
  61.  
  62.